define(()=>{
    return function(goodsMsg){
        
        $("#allflag").on("input",function(){
        
            for(let i=0;i<$(".fxk").length;i++){

              $(".fxk")[i].checked = this.checked;
            }
               goodsMsg.forEach(val=>{
                 val.flag=Number(this.checked)
               })
           localStorage.setItem("goodsMsg",JSON.stringify(goodsMsg))
           let ap = goodsMsg.reduce((start,val)=>val.flag?start+=val.num*val.price:start,0)
        $(".allprice").html(ap);
       
        })
    }
});